package com.yuanchu.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.common.utils.PageResult;
import com.yuanchu.order.dto.*;
import com.yuanchu.order.entity.YoshopOrderEntity;
import com.yuanchu.order.entity.YoshopOrderGoodsEntity;

import java.util.List;
import java.util.Map;

/**
 * 订单记录表
 *
 * @author adan
 * @email 2028038953@gmail.com
 * @date 2023-12-19 20:57:22
 */
public interface YoshopOrderService extends IService<YoshopOrderEntity> {

    /**
     * 获取交易趋势
     * @return
     */
    TradeTrendVO getTradeTrend();

    /**
     * 查询交易概况
     * @return
     */
    Overview queryOverview();

    /**
     * 查询待发货订单数量
     * @return
     */
    Map<String, String> queryPending();
    /**
     * 查询本月订单数量
     */
    List<YoshopOrderEntity> queryOrderSalesByMonth();

    List<YoshopOrderEntity> queryOrderSalesByToday();
    List<YoshopOrderEntity> queryOrderSalesByYesterday();

    Map<String, String> queryOrderStatistics();

    long queryOrderWaitSend();

    long queryPendingOrder();


    /**
     * 查询用户订单数量
     * @param userId
     * @return
     */
    UserOrderCountsDto queryOrderCounts(int userId);

    /**
     * 查询用戶订单列表
     *
     * @param dataType
     * @param page
     * @param userId
     * @return
     */
    PageResult<OrderDetailDto> queryOrderList(String dataType, int page, Integer userId);

    /**
     * 获取订单详情
     * @param orderId
     * @return
     */
    OrderDetailDto getOrderDetailByOrderId(Integer orderId, Integer userId);

    /**
     * 获取订单商品列表
     * @param orderId 订单id
     * @return
     */
    List<YoshopOrderGoodsEntity> queryOrderGoods(Integer orderId, Integer userId);

    /**
     * 获取订单商品详情
     * @param orderGoodsId
     * @return
     */
    YoshopOrderGoodsEntity queryOrderGoodsById(Integer orderGoodsId);

    /**
     * 支付订单
     * @param userId
     * @param orderId
     * @param payType
     * @return
     */
    boolean payOrderStatus(Integer userId, Integer orderId, Integer payType);

    /**
     * 取消订单
     * @param userId
     * @return
     */
    boolean cancelOrder(Integer userId, Integer orderId);

    /**
     * 确认收货
     * @param userId
     * @return
     */
    boolean receiptOrder(Integer userId, Integer orderId);



    /**
     * 获取店铺订单详情
     * @param orderId
     * @param storeId
     * @return
     */
    OrderDetailDto getStoreOrderDetail(Integer orderId, Integer storeId);

    /**
     * 获取店铺订单（批量添加es数据）
     * @param param
     * @return
     */
    PageResult<OrderDetailDto> geStoreOrderList(QueryOrderParamsDto param);

    /**
     * 订单发货
     * @param storeId
     * @param param
     */
    void deliveryOrder(Integer storeId, OrderDeliveryParamsDto param);

    /**
     * 删除订单
     * @param orderId
     * @param storeId
     */
    boolean deleteOrderById(Integer orderId, Integer storeId);

    /**
     * 订单审核
     *
     * @param orderId
     * @param status
     * @param storeId
     * @return
     */
    boolean confirmCancerOrder(Integer orderId, Integer status, Integer storeId);

    List<YoshopOrderGoodsEntity> queryOrderGoodsByOrderId(Integer orderId);

    /**
     * 查询店铺订单列表
     * @param param
     * @return
     */
    PageResult<OrderDetailDto> queryStoreOrderList(QueryOrderParamsDto param);





}

